
#include<stdio.h>
#include<coelacanth/stack.h>

void add_elements(void *stack_int)
{

   stack_ptr(tmp_stack, int);
   tmp_stack = stack_int;

   stack_push(tmp_stack, 43);
   printf("push: %d\n", stack_get(tmp_stack));

   stack_push(tmp_stack, 31);
   printf("push: %d\n", stack_get(tmp_stack));
}


int main()
{
   stack(stack, int);

   add_elements(stack);

   stack_push(stack, 17);
   printf("push: %d\n", stack_get(stack));

   stack_push(stack, 23);
   printf("push: %d\n", stack_get(stack));

   stack_push(stack, 2);
   printf("push: %d\n", stack_get(stack));

   stack_push(stack, 3);
   printf("push: %d\n", stack_get(stack));


   printf("pop: %d\n", stack_get(stack));
   stack_pop(stack);

   printf("pop: %d\n", stack_get(stack));
   stack_pop(stack);


   stack_free(stack);


   return 0;
}


